package com.school.fuyuan.business.mapper;

import com.school.fuyuan.business.model.po.Privilege;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author zrhong
 * @version 1.0
 * @date 2019/3/26 22:27
 * @description
 */
@Mapper
public interface PrivilegeMapper {
    List<Privilege> getPrivileges(List<Integer> privilegeIds);

    @Insert("insert into privilege(privilege_path) values(#{privilegePath})")
    void addPrivilege(String privilegePath);

    @Update("update privilege set privilege_path=#{privilegePath} where privilege_id=#{privilegeId}")
    void updatePrivilege(Privilege privilege);

    @Delete("delete from privilege where privilege_id=#{privilegeId}")
    void deletePrivilege(String privilegeId);

    @Delete("delete from role_privilege where privilege_id=#{privilegeId}")
    void deleteRolePrivilege(String privilegeId);
}
